The speed of light does change when it passes through air, but, to a first approximation, the change is insignificant. In any one medium, light travels in a straight line, a property known as rectilinear propagation.
When dealing with geometric optics and other situations where the wavelength of the light is much smaller than all of the dimensions of the problem, the nature of the waves can be ignored. As a result, the light can be treated as rays traveling in a series of straight lines.